package cn.pugle.base.generic;

import com.google.common.reflect.TypeToken;

import java.lang.reflect.Type;

/**
 * todo https://docs.oracle.com/javase/tutorial/java/generics/index.html
 *
 * @author tzp
 * @since 2020/7/1
 */
public class AClassNG extends AClassG<Long> {

    private final TypeToken typeToken1 = new TypeToken(getClass()) {
    };
    private final Type type1 = typeToken1.getType(); // or getRawType() to return Class<? super T>

    public AClassNG(Long o) {
        super(o);
    }

    public static void main(String[] args) {
        TypeToken<AClassNG> of = TypeToken.of(AClassNG.class);
        System.out.println(of.getType());
        AClassNG aClassNG = new AClassNG(1L);
        System.out.println(aClassNG.getT());
        System.out.println(aClassNG.getType());
        System.out.println(aClassNG.type1);
    }
}
